<template>
  <div>
    <!--面包屑导航-->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{path: '/teacher/notices'}">教师</el-breadcrumb-item>
      <el-breadcrumb-item>学生课题管理</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path: '/teacher/assignment'}">教师发布任务书</el-breadcrumb-item>
      <el-breadcrumb-item>查看任务书详情</el-breadcrumb-item>
    </el-breadcrumb>
    <!--卡片视图区域-->
    
    
  </div>
</template>

<script>
  // import {getAssignmentById} from '../../axios/assignment'
  export default {
    name: 'TeacherAssignmentView',
    data() {
      return {
        // 是否显示课题详情对话框
        dialogVisible: false,
        // 课题详情
        subjectDetail: {},
        // 发布课题教师
        teacher: {},
        // 任务书数据
        assignment: { 
          stu: {},
          sub: {},
          tea: {}
        }
      }
    },
    methods:{
      getAssignmentData(assignmentId){
        console.log(assignmentId)
        // 发送后端请求，拿到指定id的任务书详情
        // getAssignmentById(assignmentId).then(res => {
        //   if(res.data.code !== 200){
        //     this.$message.error(res.data.msg);
        //     return 
        //   }
        //   // 成功拿到任务书详情
        //   this.assignment = res.data.data
        //    this.subjectDetail = this.assignment.sub
        //   this.teacher = this.assignment.tea
        // })

        // 无后端，默认成功拿到了数据
        this.assignment = {
          id: 1, 
          status: true,
          research: '我是前端的测试数据我是前端测试数据.......',
          command: 'JavaEE, SpringBoot, Redis, MySQL, vue, elementUI...',  // 涉及的知识和基本要求
          goal: '熟练掌握JavaWeb的相关知识，并了解技术前言框架的使用',
          scheduling: '第一周.....第二周....',
          attachment: '', // 附件下载地址
          publishTime: '2022-01-24', // 发布时间
          updateTiime: '2022-01-24', // 提交时间
          stu: {id: 6109118001, name: '张三'},
          tea: {id: 610911, name: '罗翔老师', job: '讲师', college: '信息工程学院', phone: '18989099909', email: '18989099909@qq.com'},
          sub: { // 对应毕设课题
                  id: 1,
                  name: '前端模拟数据测试',
                  introduce: '测试测试测试测试测试测试',
                  declareTime: '2021-01-21',
                  source: {id: 1, label: '学生自拟'},
                  type: {id: 1, label: '理论研究'},
                  status: 1,
                  stuId: 6109118001, 
                  teaId: 610911, 
                } 
        }
        this.subjectDetail = this.assignment.sub
        this.teacher = this.assignment.tea
      }
    },
    created(){
      this.getAssignmentData(this.$route.params.id)
    }
  }
</script>

<style scoped>
  .input {
    width: 80%;
  }
</style>